Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fuzzy search of docs #1007

Merged
merged 1 commit into from
Aug 9, 2024
Merged

Fuzzy search of docs #1007

merged 1 commit into from
Aug 9, 2024

Conversation

Roy-Orbison
Copy link
Contributor

Allow partial terms and multiple search tokens instead of rigid 'begins-with' substring matching.

This isn't perfect and could probably do with some tuning of the FuzzySearch parameters, but it's better than the current, very unforgiving, method.

It also adds the .php suffix to selected autocomplete results (to match the canonical tags), stops the results list from becoming inaccessible when taller than the viewport, and drops a couple of unused variables.

php quick search

Copy link

github-actions bot commented Jun 13, 2024

🚀 Commit ba72bc3 Deployed on https://web-php-pr-1007.preview.thephp.foundation

@Roy-Orbison
Copy link
Contributor Author

Some inline styles still need to go into CSS.

Seeking feedback before marking PR as ready.

Copy link
Member

@saundefined saundefined left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

I have no objections to merge this PR, let's hear what others think.

@Roy-Orbison
Copy link
Contributor Author

I still haven't got the fuzzy search parameters right. I think I got better matches with the original commit. I've tweaked them several times but it's hard to find a balance. Other fuzzy match libraries aren't pre-packaged as a typeahead backend, and are generally more strict. I'm aiming for enough fuzziness that people who are new to the language will have a decent chance of finding a function without knowing its name.

Allow partial terms and multiple search tokens instead of rigid
'begins-with' substring matching.
Copy link
Member

@sy-records sy-records left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@sy-records sy-records merged commit 2dcf9c3 into php:master Aug 9, 2024
4 checks passed
@Roy-Orbison Roy-Orbison deleted the doc-search branch August 9, 2024 05:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants